package dao.impl;

import dao.AggrStatStepDao;
import domain.AggrStat;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import util.JDBCUtils;

import java.util.List;

public class AggrStatStepDaoImpl implements AggrStatStepDao {
    private JdbcTemplate template = new JdbcTemplate(JDBCUtils.getDataSource());
    @Override
    public List<AggrStat> SelectStep() {
        String sql = "SELECT step_length_1_3_ratio,step_length_4_6_ratio,step_length_7_9_ratio,step_length_10_30_ratio,step_length_30_60_ratio,step_length_60_ratio FROM session_aggr_stat";
        List<AggrStat> query = template.query(sql, new BeanPropertyRowMapper<AggrStat>(AggrStat.class));
        return query;
    }
}
